package com.qztc.news_end_core.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

public class MD5Parse {
    public static String encryptMD5(String str) {
        String encodedDigest = "";
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] digest = md.digest(str.getBytes());
            encodedDigest = Base64.getEncoder().encodeToString(digest);

        }catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return encodedDigest;
    }
}
